<template>
  <div class="top-bar-container">
    <div class="wrapper">
      <div class="title">
        <h2 @click="goMain">
          <img src="../../../assets/img/logo/logo.png" alt="">
        </h2>
      </div>
      <div class="search">
        <slot></slot>
      </div>
      <div class="operation">
        <Operation />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import Operation from '../operation/Operation.vue';

import { useRouter } from 'vue-router';

const router = useRouter()

const goMain = () => {
  router.push('/main')
}

</script>

<style lang="less" scoped>
@import '../../../assets/css/primary/index.less';

.top-bar-container {
  width: 100%;
  background-color: @primary-color;
  height: 88px;
  display: flex;
  align-items: center;
  min-width: 1040px;

  .wrapper {
    margin: 0 auto;
    width: 1552px;

    height: 100%;
    display: flex;

    .title {
      flex: 1;

      h2 {
        padding: 8px 0;
        margin: 0 auto;
        width: 166px;
        height: 72px;
        cursor: pointer;
        font-family: fantasy;
        text-align: center;
        font-size: 40px;
        line-height: 72px;

        img {
          width: 72px;
          scale: 1.2;
        }
      }
    }

    .search {
      flex: 3;
    }

    .operation {
      flex: 1;
    }
  }

  @media (max-width: 1552px) {
    .wrapper {
      width: 1296px;
    }
  }

  @media (max-width: 1296px) {
    .wrapper {
      width: 1040px;
    }
  }

}
</style>
